import request from "@/util/http";

// 获取帖子列表
export function getAuditList() {
  return request({
    url: '/api/audit',
    method: 'get',
    headers: {
      token: localStorage.getItem('token')
    },
    
  })
}
export const getAuditById = (id) => {
  return request({
    url: `/api/audit/${id}`,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
      'token': localStorage.getItem('token')
    },
  });
};

// 删除帖子
export function deleteAudit(data) {
  return request({
    url: `/api/audit`,
    method: 'delete',
    data,
    headers: {
      'Content-Type': 'application/json',
      'token': localStorage.getItem('token')
    },
  });
}

// 更新帖子
export function updateAudit(data) {
  return request({
    url: `/api/audit`,
    method: 'put',
    data,
    headers: {
      'Content-Type': 'application/json',
      'token': localStorage.getItem('token')
    },
  });
}

export function addAudit( data) {
  return request({
    url: `/api/audit`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json',
      'token': localStorage.getItem('token')
    },
  });
}

